package com.example.config;


import com.example.filter.CustomGateWayFilter;
import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;

//@Configuration
public class GateWayRoutesConfiguration {

    @Bean
    public RouteLocator customizedRoutes(RouteLocatorBuilder builder) {
        return builder.routes()
                .route(r ->
                        r.path("/client/**")
                                .filters(
                                        f -> f.filters(new CustomGateWayFilter())
                                )
                                .uri("lb://client-service")
                )
                .build();
    }

}
